<?php

function racetime($racetime,$cookieuser,$quota,$racetimenum){
$time=time();
$times=mktime(date("H")+1,0,0,date("m"),date("d"),date("Y"));
$timecha=$times-$time;

if ($time>=$racetime){
$racetimes=$time+$timecha+rand(0,3600);
$racetimenum=$racetimenum + 1;
$quota=$quota + 5;
mysql_query("UPDATE xige_data SET main= '$racetimes' WHERE name= 'racetimes'");
mysql_query("UPDATE xige_info SET quota='$quota',racetime= '$racetimenum' WHERE email= '$cookieuser'");
echo "尼玛!居然抢到了";
}else{
$shicha=$racetime - $time;
echo "还差".$shicha."秒";
}

}
?>